package com.mall.user.domain.model;

public record StorePhone(String phone) {
    public StorePhone {
        //店铺商家电话长度必须在0到20个字符之间
        if (phone.length() > 20) {
            throw new IllegalArgumentException("店铺商家电话长度必须在0到20个字符之间");
        }
    }

    public static StorePhone of(String phone) {
        return new StorePhone(phone);
    }
}
